#include<iostream>
#include<vector>
#include<unordered_map>
using namespace std;
unordered_map<int,vector<int>> mp;
int main()
{
	int n;cin >> n;
	while (n--)
	{
		int a, b;cin >> a >> b;
		mp[a].push_back(b);
		mp[b].push_back(a);
	}
	return 0;
}